Skip to content

Conversation

@seldridge
Copy link
Member

@seldridge seldridge commented Sep 27, 2025

Change domains to behave almost exactly like classes. They now have
input and outputs (which can be used by their existing bodies).

This could alternatively be solved by using a simpler representation for
domains. However, this would be better handled with a full cleanup of how
classes are modeled.

TODO:

  • Preserve ports and properties in LowerDomains. (64f2628)

This is stacked on #8929.

@seldridge seldridge force-pushed the dev/seldridge/firrtl-make-domains-class-like branch from 64f2628 to f4d176c Compare October 1, 2025 16:51
@seldridge seldridge force-pushed the dev/seldridge/firrtl-erase-domains branch from 9f28b09 to 76e8bbd Compare October 1, 2025 16:51
@seldridge seldridge force-pushed the dev/seldridge/firrtl-make-domains-class-like branch 2 times, most recently from da4b15c to 071ea2b Compare October 1, 2025 17:30
@seldridge seldridge force-pushed the dev/seldridge/firrtl-erase-domains branch from 76e8bbd to bffc683 Compare October 1, 2025 17:30
ArrayRef<Attribute> DomainOp::getPortAnnotations() { return {}; }

void DomainOp::setPortAnnotationsAttr(ArrayAttr annotations) {
llvm_unreachable("domains do not support annotations");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider report fatal error instead? I don't know why this would be unreachable.

cc #3836 .

We don't want compilers being told this is unreachable, as that means anything reaching it is also "unreachable" and can to bizarre behaviors, like eliding branches/checks entirely knowing they lead to unreachable code.
OTOH that's exactly what it's good for.

I see that we do this for the ClassOp definitions, which hopefully is almost exactly a copy of :), so leaving it as-is is fine.

Since presumably it is presently unreachable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is all copied from the ClassOp definitions. I agree that this isn't great.

@seldridge seldridge force-pushed the dev/seldridge/firrtl-erase-domains branch from 4ab6d85 to 39455de Compare October 2, 2025 19:00
@seldridge seldridge force-pushed the dev/seldridge/firrtl-make-domains-class-like branch 5 times, most recently from 8aede17 to 206c1e8 Compare October 9, 2025 00:07
Base automatically changed from dev/seldridge/firrtl-erase-domains to main October 10, 2025 17:36
Change domains to behave almost exactly like classes.  They now have
input and outputs (which can be used by their existing bodies).

This could alternatively be solved by using a simpler representation for
domains.  However, this would be better handled with a full cleanup of how
classes are modeled.

Signed-off-by: Schuyler Eldridge <[email protected]>
@seldridge seldridge force-pushed the dev/seldridge/firrtl-make-domains-class-like branch from 206c1e8 to 73f465c Compare October 10, 2025 17:41
@seldridge seldridge marked this pull request as ready for review October 10, 2025 20:21
@seldridge seldridge requested a review from darthscsi as a code owner October 10, 2025 20:21
@seldridge seldridge requested a review from dtzSiFive October 10, 2025 20:21
@seldridge seldridge closed this in 353e0bd Oct 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants